
#ifndef _PID_H_
#define _PID_H_
#include "zf_common_headfile.h"




#define PID_CREATE(_kp, _ki, _kd, _low_pass, max_p, max_i, max_d) \
    {                                    \
        .kp = _kp,                       \
        .ki = _ki,                       \
        .kd = _kd,                       \
        .low_pass = _low_pass,           \
        .out_p = 0,                      \
        .out_i = 0,                      \
        .out_d = 0,                      \
        .p_max = max_p,                  \
        .i_max = max_i,                  \
        .d_max = max_d,                  \
    }



float pid_solve(pid_param_t *pid, float error);
float increment_pid_solve(pid_param_t *pid, motor_param* motor);
float bangbang_pid_solve (pid_param_t *pid, motor_param* motor);
float changable_pid_solve (pid_param_t *pid,motor_param* motor);
float pid_solve_nom(pid_param_t *pid, float error);





#endif   /* _PID_H_ */
